home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / comm / ums / pint.lha / UMS / Rexx / PGPDecrypt.pint < prev    next >
Text File  |  1997-03-04  |  1KB  |  68 lines

  1. /*
  2.  
  3.    $VER: PGPDecrypt.pint 1.0 (27.8.95)
  4.  
  5.    Author:
  6.     Matthias Scheler (tron@lyssa.owl.de)
  7.  
  8.    Updated for PINT (22.2.97):
  9.     Magnus Heino (nd95mho@Student.HGS.SE)
  10.  
  11.    Function:
  12.     decrypts the PGP message show in PINT's message window.
  13.  
  14.    History:
  15.     0.1   initial version
  16.     0.2   decided to get rid of this strange AMOK style header and
  17.           went back to my good old standard
  18.     0.3   uses new "EXEC" command
  19.     1.0   released with IntuiNews 1.3
  20.  
  21.    Requires:
  22.     PGP 2.6ui (2.3a didn't work in every case) in command path of ARexx
  23.  
  24.    Example for "ums.config":
  25.     ( PINT.Rexx
  26.     ...
  27.         "MessageWindow           F4      PGPDecrypt.PINT\n"
  28.     ...
  29.     )
  30.  
  31. */
  32.  
  33. /* Exit if Message Window is not active. */
  34.  
  35. OPTIONS RESULTS
  36.  
  37. STATUS
  38. IF RESULT~="MESSAGE" THEN EXIT 5
  39.  
  40. /* Ask the user for the PGP phrase. */
  41.  
  42. 'GETSTRING TITLE "PGP Decrypt" LABEL "_Phrase" SECRET'
  43. IF RESULT="RESULT" THEN EXIT 5
  44. Phrase=RESULT
  45.  
  46. /* We get PINT's message number, ... */
  47.  
  48. GETMSGNUM
  49. MsgNum=RESULT
  50.  
  51. /* ... save the message, ... */
  52.  
  53. 'SAVEMSGBODY' MsgNum 'TO T:PINT.pgp'
  54.  
  55. /* ... call PGP, ... */
  56.  
  57. 'EXEC SetEnv PGPPASS "'||Phrase||'"'
  58. 'EXEC pgp +BATCHMODE T:PINT.pgp -o T:PINT.asc'
  59. 'EXEC UnSetEnv PGPPASS'
  60.  
  61. /* ... and show the decrypted message. */
  62.  
  63. 'REPLACEMSGBODY WITH T:PINT.asc'
  64.  
  65. /* cleanup */
  66.  
  67. 'EXEC Delete T:PINT.(asc|pgp) QUIET'
  68.